﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.Web;
using TMDT_Nhom1A.DTO;
namespace TMDT_Nhom1A.DAO
{
    public class ParentCatalogue_DAO
    {
        private static QL_DoanhNghiepDataContext qldoanhnghiep = new QL_DoanhNghiepDataContext();

        public static List<PARENT_CATALOGUE> ListKeyCatalogue()
        {
            List<PARENT_CATALOGUE> listkeycatalogue = new List<PARENT_CATALOGUE>();
            var list = from pc in qldoanhnghiep.PARENT_CATALOGUEs
                       select new
                       {
                           pc.ParentCatalogue_ID,
                           pc.ParentCatalogue_Name
                       };
            foreach (var item in list)
            {
                PARENT_CATALOGUE catalogue = new PARENT_CATALOGUE();
                catalogue.ParentCatalogue_ID = item.ParentCatalogue_ID;
                catalogue.ParentCatalogue_Name = item.ParentCatalogue_Name;
                listkeycatalogue.Add(catalogue);
            }
            return listkeycatalogue;
        }
    }
}
